<template>
  <div>{{ m }}分{{ s }}秒</div>
</template>


<script>
export default {
  props: ["time"],
  data() {
    return {
      newTime: 0,
      m: 0,
      s: 0,
    };
  },
  created() {
    this.newTime = this.time / 1000;
    this.countDown();
  },
  methods: {
    countDown() {
      setInterval(() => {
        this.newTime--;
        this.m = Math.floor(this.newTime / 60);
        this.s = Math.floor(this.newTime % 60);
      }, 1000);
    },
  },
};
</script>
